home *** CD-ROM | disk | FTP | other *** search
/ MacFormat España 15 / macformat_15.iso / C de cerca / Codewarrior Lite / MacOS Support / Headers / ANSI Headers / yxvals.h < prev   
Text File  |  1995-12-29  |  2KB  |  87 lines

  1. // yxvals.h values header for C++
  2. #ifndef _YXVALS_
  3. #define _YXVALS_
  4. #ifndef _YVALS
  5.  #include <yvals.h>
  6. #endif
  7.  
  8. #if __MWERKS__
  9. #pragma options align=mac68k
  10.  
  11. #if __CFM68K__ && __USING_IMPORTED_ANSI__
  12. #pragma import on
  13. #endif
  14. #endif
  15.  
  16.   // typeinfo description type
  17. typedef int _Typedesc;
  18.   // type bool
  19. #if _HAS_BOOL_TYPE
  20.  typedef bool _Bool;
  21. #else
  22.  typedef int _Bool;
  23. #endif /* _HAS_BOOL_TYPE */
  24.   // exception macros
  25. #if _HAS_EXCEPTIONS
  26.  #define _TRY_BEGIN try {
  27.  #define _CATCH_ALL } catch (...) {
  28.  #define _CATCH_END }
  29.  #define _RAISE(x) throw (x)
  30.  #define _RERAISE throw
  31. #elif _MICROSOFT_EXCEPTIONS
  32.  #define _TRY_BEGIN TRY
  33.  #define _CATCH_ALL CATCH(CException, _PCEx)
  34.  #define _CATCH_END END_CATCH
  35.  #define _RAISE(x) THROW(&(x))
  36.  #define _RERAISE THROW_LAST()
  37. #else /* no exceptions */
  38.  #define _TRY_BEGIN {{
  39.  #define _CATCH_ALL } if (0) {
  40.  #define _CATCH_END }}
  41.  #define _RAISE(x) xmsg::_Throw(&(x))
  42.  #define _RERAISE xmsg::_Throw(0)
  43. #endif
  44.   // bitmask macros
  45. #if _HAS_ENUM_OVERLOADING
  46.  #define _BITMASK(E, T) typedef E T
  47.  #define _BITMASK_OPS(T) \
  48. inline T& operator&=(T& _X, T _Y) \
  49.  {_X = (T)((int)_X & (int)_Y); return (_X); } \
  50. inline T& operator|=(T& _X, T _Y) \
  51.  {_X = (T)((int)_X | (int)_Y); return (_X); } \
  52. inline T& operator^=(T& _X, T _Y) \
  53.  {_X = (T)((int)_X ^ (int)_Y); return (_X); } \
  54. inline T operator&(T _X, T _Y) \
  55.  {return ((T)((int)_X & (int)_Y)); } \
  56. inline T operator|(T _X, T _Y) \
  57.  {return ((T)((int)_X | (int)_Y)); } \
  58. inline T operator^(T _X, T _Y) \
  59.  {return ((T)((int)_X ^ (int)_Y)); } \
  60. inline T operator~(T _X) \
  61.  {return ((T)~(int)_X); }
  62. #else
  63.  #define _BITMASK(E, T) typedef int T
  64.  #define _BITMASK_OPS(T)
  65. #endif /* _HAS_ENUM_OVERLOADING */
  66. #define _HAS_PJP_CLIB 1 /* for filebuf/FILE coordination */
  67.  
  68. #if __MWERKS__
  69. #if __CFM68K__ && __USING_IMPORTED_ANSI__
  70. #pragma import reset
  71. #endif
  72.  
  73. #pragma options align=reset
  74. #endif
  75.  
  76. #endif /* _YXVALS_ */
  77.  
  78. /*
  79.  * Copyright (c) 1994 by P.J. Plauger.  ALL RIGHTS RESERVED. 
  80.  * Consult your license regarding permissions and restrictions.
  81.  */
  82.  
  83. /* Change log:
  84.  *94Oct03 Version received from PlumHall
  85.  *94Oct08 Inserted MW changes.
  86.  */
  87.